package net.bw.realtime.jtp.mapper;

import net.bw.realtime.jtp.bean.TrafficUvReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author liuyawei
 * @date 2025/0/5/21
 */
@Mapper
public interface TrafficChannelStatsMapper {

    // 获取指定日期的各个渠道的uv统计数据
    @Select("SELECT\n" +
            " channel,\n" +
            " sum(uv_count) AS uv_count\n" +
            "FROM jtp_log_report.dws_traffic_page_view_window_report\n" +
            "WHERE toDate(window_start_time) = #{date}\n" +
            "GROUP BY channel")
    List<TrafficUvReport> selectUvCount(@Param("date") String date);

}
